#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
    inline int judgeUpDown
    inline bool judgeSale(int currentIdx, vector<int>& prices, int lastPrice, int fee) {

    }
    int maxProfit(vector<int>& prices, int fee) {

    }
};

int main() {
    Solution s;
    int n;
    cin >> n;
    vector<int> prices(n);
    for (int i = 0; i < n; i++) {
        cin >> prices[i];
    }
    int fee;
    cin >> fee;
    return 0;
}